﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Site.master" AutoEventWireup="true" CodeBehind="QLTheLoai.aspx.cs" Inherits="Indochinaodyssey.Admin.QLTheLoai" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:Label ID="Label1" runat="server" Text="Quản lý thể loại" Font-Bold="True" 
        Font-Size="15pt"></asp:Label>
    <asp:MultiView ID="mtvTheLoai" runat="server" ActiveViewIndex="0">
        <asp:View ID="viewTalbe" runat="server">
            <table class="style1">
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="right">
                        <asp:Label ID="lblMes" runat="server"></asp:Label>
                        <asp:Button ID="btnCreateBtn" runat="server" Text="Thêm mới" 
                            onclick="btnCreateBtn_Click" CausesValidation="False" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:GridView ID="grvTheLoai" runat="server" AutoGenerateColumns="False" 
                            BackColor="White" BorderColor="#999999" BorderStyle="None" BorderWidth="1px" 
                            CellPadding="3" DataKeyNames="ID" DataSourceID="SqlDataSourceTheLoai" 
                            GridLines="Vertical" Width="100%" AllowPaging="True" AllowSorting="True">
                            <AlternatingRowStyle BackColor="#DCDCDC" />
                            <Columns>
                                <asp:BoundField DataField="ROW" HeaderText="No" ReadOnly="True" 
                                    SortExpression="ROW">
                                <ItemStyle BackColor="#FFCC00" HorizontalAlign="Center" Width="50px" />
                                </asp:BoundField>
                                <asp:BoundField DataField="TenTheLoai" HeaderText="THỂ LOẠI" 
                                    SortExpression="TenTheLoai" />
                                <asp:BoundField DataField="MoTa" HeaderText="MÔ TẢ" SortExpression="MoTa" />
                                <asp:BoundField DataField="STT" HeaderText="VỊ TRÍ HIỆN THỊ" 
                                    SortExpression="STT" />
                                <asp:CheckBoxField DataField="Hot" HeaderText="HOT" SortExpression="Hot" />
                                <asp:TemplateField HeaderText="ACTION">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="btnSua" runat="server" onclick="btnSua_Click">Sửa</asp:LinkButton>
                                        &nbsp;<asp:LinkButton ID="btnXoa" runat="server" onclick="btnXoa_Click" 
                                            onclientclick="return confirm('Bạn chắc chắn muốn xóa?');">Xóa</asp:LinkButton>
                                        <asp:HiddenField ID="hfID" runat="server" Value='<%# Eval("ID") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
                            <HeaderStyle BackColor="#29587F" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
                            <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
                            <SortedAscendingCellStyle BackColor="#F1F1F1" />
                            <SortedAscendingHeaderStyle BackColor="#0000A9" />
                            <SortedDescendingCellStyle BackColor="#CAC9C9" />
                            <SortedDescendingHeaderStyle BackColor="#000065" />
                        </asp:GridView>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:SqlDataSource ID="SqlDataSourceTheLoai" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                            
                            SelectCommand="SELECT ROW_NUMBER() OVER (ORDER BY dbo.tblTheLoai.ID DESC) AS ROW, dbo.tblTheLoai.ID, dbo.tblTheLoai.TenTheLoai, dbo.tblTheLoai.MaQuocGia, dbo.tblTheLoai.MoTa, dbo.tblTheLoai.STT, dbo.tblTheLoai.Hot FROM dbo.tblTheLoai">
                        </asp:SqlDataSource>
                    </td>
                </tr>
            </table>
        </asp:View>
        <asp:View ID="viewCreate" runat="server">
            <table class="style1">
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="right">
                        &nbsp;</td>
                    <td align="right">
                        <asp:Button ID="Button1" runat="server" Text="Quay lại" 
                            onclick="btnCanCel_Click" CausesValidation="False" />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="right">
                       Tên danh mục phụ: </td>
                    <td>
                        <asp:TextBox ID="txtName" runat="server" Width="690px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                            ControlToValidate="txtName" ErrorMessage="(*)" ForeColor="Red"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="right">
                        Vị trí hiện thị: </td>
                    <td>
                        <asp:TextBox ID="txtViTri" runat="server" 
                            Width="50px">1</asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                            ControlToValidate="txtViTri" ErrorMessage="(*)" ForeColor="Red"></asp:RequiredFieldValidator>
                        &nbsp;- Danh mục hot :
                        <asp:CheckBox ID="ckbHot" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="right">
                        &nbsp;</td>
                    <td>
                        <asp:FileUpload ID="fileUp" runat="server" Visible="False" />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="right" valign="top">
                        Mô tả: </td>
                    <td>
                        <asp:TextBox ID="txtMota" runat="server" Height="55px" TextMode="MultiLine" 
                            Width="700px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="right" valign="top">
                        &nbsp;</td>
                    <td>
                        <asp:Button ID="btnCreate" runat="server" Text="Tạo danh mục phụ" 
                            onclick="btnCreate_Click" />
                        &nbsp;<asp:Button ID="btnCanCel" runat="server" Text="Hủy" Width="98px" 
                            onclick="btnCanCel_Click" CausesValidation="False" />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="right" valign="top">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
            </table>
        </asp:View>
        <asp:View ID="viewEdit" runat="server">
         <table class="style1">
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="right">
                        <asp:HiddenField ID="hfID" runat="server" />
                    </td>
                    <td align="right">
                        <asp:Button ID="Button3" runat="server" Text="Quay lại" 
                            onclick="btnCanCel_Click" />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="right">
                       Tên danh mục phụ: </td>
                    <td>
                        <asp:TextBox ID="txtNameEdit" runat="server" Width="690px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                            ControlToValidate="txtNameEdit" ErrorMessage="(*)" ForeColor="Red" ></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="right">
                        Vị trí hiện thị: </td>
                    <td>
                        <asp:TextBox ID="txtViTriEdit" runat="server" 
                            Width="50px">1</asp:TextBox>
                        &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                            ControlToValidate="txtViTriEdit" ErrorMessage="(*)" ForeColor="Red"></asp:RequiredFieldValidator>
                        - Danh mục hot :
                        <asp:CheckBox ID="ckbHotEdit" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="right">
                        &nbsp;</td>
                    <td>
                        <asp:FileUpload ID="fileEdit" runat="server" Enabled="False" Visible="False" />
                        <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" 
                            oncheckedchanged="CheckBox1_CheckedChanged" Text="Đổi ảnh ?" Visible="False" />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="right" valign="top">
                        Mô tả: </td>
                    <td>
                        <asp:TextBox ID="txtMotaEdit" runat="server" Height="55px" TextMode="MultiLine" 
                            Width="700px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="right" valign="top">
                        &nbsp;</td>
                    <td>
                        <asp:Button ID="btnEdit" runat="server" Text="Sửa danh mục phụ" 
                            onclick="btnEdit_Click" />
                        &nbsp;<asp:Button ID="Button5" runat="server" Text="Hủy" Width="98px" 
                            onclick="btnCanCel_Click" CausesValidation="False" />
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td align="right" valign="top">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
            </table>
        </asp:View>
    </asp:MultiView>
</asp:Content>
